<!DOCTYPE html>
<html  class="x-admin-sm">
<head>
	<meta charset="UTF-8">
	<title>内部管理系统 - </title>
	<meta name="renderer" content="webkit|ie-comp|ie-stand">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width,height=device-height,initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no">
    <meta http-equiv="Cache-Control" content="no-siteapp" />
    <link rel="stylesheet" href="__ADMIN__/css/font.css">
    <link rel="stylesheet" href="__ADMIN__/css/font-awesome.min.css">
	<link rel="stylesheet" href="__ADMIN__/css/xadmin.css?v=1.1">
    <link rel="stylesheet" href="__ADMIN__/lib/layui/css/layui.css">
    <script type="text/javascript" src="__ADMIN__/js/jquery.min.js"></script>
    <script type="text/javascript" src="__ADMIN__/lib/layui/layui.js"></script>
    <script type="text/javascript" src="__ADMIN__/js/xadmin.js"></script>
    <script type="text/javascript" src="__ADMIN__/js/cookie.js"></script>
    <script>
        // 是否开启刷新记忆tab功能
        // var is_remember = false;
    </script>
    <style>
    .container .layui-nav .layui-nav-item .layui-nav-more{ top:0;}

    </style>
</head>
<body>
    <!-- 顶部开始 -->
    <div class="container">
        <!-- <div class="logo" style="text-align: center;"><a href="./index.html">中原电工</a></div> -->
        <div class="left_open">
            <!-- <i title="展开左侧栏" class="iconfont">&#xe699;</i> -->
            <i title="展开左侧栏" class="layui-icon layui-icon-shrink-right"></i>
        </div>
        <ul class="layui-nav right" lay-filter="">
            <li class="layui-nav-item" style="line-height: 45.5px;">
                <a href="javascript:x_admin_show('上传美图','/admin.php/index/uploadAvatar','','300','300');" style="color: #333;">上传美图</a>
            </li>
            <li class="layui-nav-item" style="line-height: 45.5px;">
                <a href="javascript:;" style="color: #333;"><img src="/admin.php/ds/avatar/" style="width:19px;height:19px;border-radius:50%;"> <?php echo session('uname','','admin');?></a>
                <dl class="layui-nav-child"> <!-- 二级菜单 layui-show -->
                    <dd><a href="{:url('Login/save_pass')}">修改密码</a></dd>
                    <dd><a href="{:url('Login/logout')}">退出登陆</a></dd>
                </dl>
            </li>
        </ul>
    </div>
    <!-- 顶部结束 -->
    <!-- 中部开始 -->
     <!-- 左侧菜单开始 -->
    <div class="left-nav">
      <div id="side-nav">
        <ul id="nav">
            <div><a href="./index.html"  style="text-align: center;padding: 12px 15px 12px 20px;display: block;cursor: pointer;font-size: 18px;color: #fff;">内部管理系统</a></div>
            {volist name="menuRes" id="menu"}
            <li date-refresh="1"  {if condition="$menu.id eq 240"}id="shenhe-li"{/if} class="menu-li-{$menu.id}">
                <a {if condition="$menu['children']"}href="javascript:;"{else/}_href="{:url($menu.name)}"{/if}>
                    <i class="fa {$menu.icon} fa-fw"></i>
                    <cite>{$menu.title}</cite>
                    {if condition="$menu['children']"}<i class="iconfont nav_right">&#xe697;</i>{/if}
                </a>
                {if condition="$menu['children']"}
                <ul class="sub-menu">
                    {volist name="$menu['children']" id="children"}
                    <li date-refresh="1" 
                    {if condition="$children.id eq 233"}id="khc-li"{/if}
                    {if condition="$children.id eq 277"}id="guanlian-li"{/if}
                    {if condition="$children.id eq 246"}id="xuqi-li"{/if}
                    {if condition="$children.id eq 288"}id="lurushenqing-li"{/if}
                    {if condition="$children.id eq 325"}id="daifahuo-li"{/if}
                    {if condition="$children.id eq 343"}id="contract-li"{/if}
                     class="menu-child-{$children.id}"
                    >
                        <a _href="{:url($children.name)}">
                            <i class="fa {$children.icon} fa-fw"></i>
                            <cite>{$children.title}</cite>
                        </a>
                    </li>
                    {/volist}
                </ul>
                {/if}
            </li>
            {/volist}
        </ul>
      </div>
    </div>
    <!-- 左侧菜单结束 -->
    <!-- 右侧主体开始 -->
    <div class="page-content">
        <div class="layui-tab tab" lay-filter="xbs_tab" lay-allowclose="false">
          <ul class="layui-tab-title">
            <li class="home"><i class="layui-icon">&#xe68e;</i>我的桌面</li>
          </ul>
          <div class="layui-unselect layui-form-select layui-form-selected" id="tab_right">
                <dl>
                    <dd data-type="this">关闭当前</dd>
                    <dd data-type="other">关闭其它</dd>
                    <dd data-type="all">关闭全部</dd>
                </dl>
          </div>
          <div class="layui-tab-content">
            <div class="layui-tab-item layui-show">
                <iframe src="{:url('Index/welcome')}" frameborder="0" scrolling="yes" class="x-iframe"></iframe>
            </div>
          </div>
          <div id="tab_show"></div>
        </div>
    </div>
    <div class="page-content-bg"></div>
    <!-- 右侧主体结束 -->
    <!-- 中部结束 -->
    <!-- 底部开始 -->
<!--     <div class="footer">
        <div class="copyright">Copyright ©2019</div>
    </div> -->
    <!-- 底部结束 -->

<script type="text/javascript">
layui.use(['jquery','layer'], function(){
    $ = layui.jquery
    ,layer = layui.layer;
    autoUpdate();
    var timer = window.setInterval(autoUpdate,30000);
    function autoUpdate(){
        $.get('{:url("ds/autoUpdate")}',function(data){
            //console.log(data);
            if(data.xuqiCount>0)
                $('#xuqi-li cite').html('续期审核列表 <span class="layui-badge">'+data.xuqiCount+'</span>');
            else
                $('#xuqi-li cite').html('续期审核列表');
            if(data.applyCount>0)
                $('#guanlian-li cite').html('关联审核列表 <span class="layui-badge">'+data.applyCount+'</span>');
            else
                $('#guanlian-li cite').html('关联审核列表');
            if(data.addApplyCount>0)
                $('#lurushenqing-li cite').html('录入申请列表 <span class="layui-badge">'+data.addApplyCount+'</span>');
            else
                $('#lurushenqing-li cite').html('录入申请列表');  
            if(data.contractCount>0)
                $('#contract-li cite').html('签单审核列表 <span class="layui-badge">'+data.contractCount+'</span>');
            else
                $('#contract-li cite').html('签单审核列表');
            if(data.applyCount>0 || data.xuqiCount>0 || data.addApplyCount>0 || data.contractCount>0)    
                $('#shenhe-li cite').eq(0).html('<font color="red">有未处理审核</font>');
            else
                $('#shenhe-li cite').eq(0).html('审核列表');
            if(data.khcCount>0)
                $('#khc-li cite').eq(0).html('客户池 <span class="layui-badge  layui-bg-blue">'+data.khcCount+'</span>');
            else
                $('#khc-li cite').eq(0).html('客户池'); 
            if(data.backOrderCount>0)
                $('#daifahuo-li cite').eq(0).html('待发货 <span class="layui-badge">'+data.backOrderCount+'</span>');
            else
                $('#daifahuo-li cite').eq(0).html('待发货'); 
            
            
            if(data.sqRemindCount>0 || data.zxRemindCount>0 || data.jsRemindCount>0)    
                $('.menu-li-299 cite').eq(0).html('<font color="red">有需要操作的内容</font>');
            else
                $('#shenhe-li cite').eq(0).html('审核列表');
                
            if(data.sqRemindCount>0)
                $('.menu-child-354 cite').eq(0).html('直播申请表 <span class="layui-badge">'+data.sqRemindCount+'</span>');
            else
                $('.menu-child-354 cite').eq(0).html('直播申请表'); 
            if(data.zxRemindCount>0)
                $('.menu-child-355 cite').eq(0).html('直播执行表 <span class="layui-badge">'+data.zxRemindCount+'</span>');
            else
                $('.menu-child-355 cite').eq(0).html('直播执行表'); 
            if(data.jsRemindCount>0)
                $('.menu-child-356 cite').eq(0).html('直播结算表 <span class="layui-badge">'+data.jsRemindCount+'</span>');
            else
                $('.menu-child-356 cite').eq(0).html('直播结算表'); 
            
            if(data.workremind){
                layer.open({
                    type: 2,
                    title: '你的工作总结已被批复，请查看',
                    shadeClose: false,
                    shade: true,
                    maxmin: false,
                    area: ['800px', '600px'],
                    content: '{:url('work/cont')}/id/'+data.workremind.id
                });
            }
            var qiandanRemind;
            if(data.qiandanCount > 0 && (qiandanRemind != 'undefined' && !qiandanRemind) ){
                
                var qiandanRemind = layer.open({
                    type: 2,
                    title: false,
                    shadeClose: false,
                    shade: false,
                    maxmin: false,
                    area: ['360px', '150px'],
                    offset: 'rb',
                    content: '{:url('client/qiandanRemind')}'
                });
            }
        },'json');

    }
})
</script>
</body>
</html>